﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace B.S.Data.ERP.API
{
    /// <summary>
    /// 全局异常过滤器
    /// </summary>
    public class ERPGuoFilters : IExceptionFilter
    {
        private readonly ILogger<ERPGuoFilters> logger;

        public ERPGuoFilters(ILogger<ERPGuoFilters> logger)
        {
            this.logger = logger;
        }

        public void OnException(ExceptionContext context)
        {
            logger.LogError($"【捕获到异常信息内容为】" + context.Exception.Message);
        }
    }
}
